'use strict';
exports.main = async (event, context) => {
	const { tel, code } = event;
	const {  data  } = await uniCloud.database().collection("userList").where({
		tel: tel,
		code: code
	}).get();
		
	if(data.length) {
		return {
			code: 200,
			data: data[0],
			message: '登录成功'
		}
	} else {
		return {
			code: 400,
			message: '验证码错误， 请重新输入'
		}
	}
};
